package itcz.example.pattern.structure_type.flyweight;

/**
 * @ClassName: Client
 * @Author: ITCZ
 * @Date: 2025-06-27
 * @Description: 测试类
 */
public class Client {
    public static void main(String[] args) {
        Abstractbox box1 = BoxFactory.getInstance().getBox("I");
        box1.display("yellow");
        Abstractbox box2 = BoxFactory.getInstance().getBox("L");
        box2.display("blue");
        Abstractbox box3 = BoxFactory.getInstance().getBox("O");
        box3.display("green");
        Abstractbox box4 = BoxFactory.getInstance().getBox("I");
        box4.display("red");

        System.out.println(box1 == box4);
    }
}
